package com.udl.emailfs.main;

import java.rmi.Remote;
import java.rmi.RemoteException;
import org.jdom.JDOMException;

import com.udl.emailfs.file.FileDescriptor;

import javax.mail.MessagingException;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.File;
import java.security.NoSuchAlgorithmException;
import java.text.ParseException;

/**
 *
 * @author Edin Guermas Argiles
 */

public interface InterfaceRemoto extends Remote {

    public FileDescriptor open(String path, FileDescriptor fd, String mode) throws RemoteException, NoSuchAlgorithmException, java.security.NoSuchProviderException, MessagingException, JDOMException, IOException, ParseException, InterruptedException;
    public int close(FileDescriptor fd) throws RemoteException, MessagingException, JDOMException, IOException, ParseException;
    public FileDescriptor create(String remotepath, File f) throws RemoteException, IOException, JDOMException, ParseException, java.security.NoSuchProviderException, NoSuchAlgorithmException, MessagingException;
    public int write(FileDescriptor fd, byte[] b, int numbytes) throws RemoteException, FileNotFoundException, IOException, MessagingException, ParseException, JDOMException, InterruptedException;
    public byte [] read(FileDescriptor fd, byte[] b, int size) throws FileNotFoundException, IOException, MessagingException, JDOMException, ParseException;
    public int delete(FileDescriptor fd) throws RemoteException;
    public void compact(FileDescriptor fd) throws RemoteException, IOException, ParseException;
}
